package com.Service.impl;


import com.Service.StudentService;
import com.domain.Student;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.dao.StuDao;

public class StudentServiceImpl implements StudentService {
    private StuDao stuDao;

    public void setStuDao(StuDao stuDao) {
        this.stuDao = stuDao;
    }

    @Override
    public Page pageQuery(Integer start, Integer pageSize) {
        Page<Student> page = PageHelper.startPage(start, pageSize);
        stuDao.findAll();
        return page;
    }

    @Override
    public void addStu(Student stu) {
        stuDao.addStu(stu);
    }

    @Override
    public void delStu(Integer id) {
       stuDao.delStu(id);
    }

    @Override
    public void updateStu(Student stu) {
        stuDao.updateStu(stu);
    }

    @Override
    public Page findStu(Student stu, Integer start, Integer pageSize) {
        Page<Student> page = PageHelper.startPage(start, pageSize);
        stuDao.findStu(stu);
        return page;
    }
}